<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home</title>
</head>
<body>
    <button class="get-data">获取数据</button>
</body>
<script src="./consts.js"></script>
<script src="./request.js"></script>
<script src="./service.js"></script>
<script>
    const optBtn = document.querySelector('.get-data')

    async function handleClick() {
        const res = await getData()
        console.log('获取成功：',res)
    }

    optBtn.addEventListener('click',handleClick)
</script>
</html>